@typeparam TItem

@typeparam TValue

@inherits BaseInputBlock<TValue>

@namespace FluentCMS.Web.UI.Components

@if (Visible)
{
    <FormField Cols="Cols" Dense="@Dense" Id="@Id" Hint="@Hint" Label="@Label" LabelFragment="@LabelFragment" Required="@Required">
        @if (ChildContent == null)
        {
            if (Data != null && Data.Any())
            {
                <div class="@this.GetClasses()">
                    @foreach (var item in Data)
                    {
                        <div class="@this.ClassName("FormRadioGroupInputWrapper")">
                            <input @attributes="AdditionalAttributes" @onchange="(e) => HandleChange(e, GetValue(item))"
                                   checked="@IsChecked(item)" disabled="@Disabled" class="@this.ClassName("FormRadioGroupInput")" 
                                   id="@($"{Id}_{GetValue(item)}")" name="@NameAttributeValue" type="radio" value="@GetValue(item)">
                            <label for="@($"{Id}_{GetValue(item)}")" class="@this.ClassName("FormRadioGroupLabel")">
                                @GetText(item)
                            </label>
                        </div>
                    }
                </div>
            }
        }
        else
        {
            @ChildContent
        }
    </FormField>
}